from selenium.webdriver.common.by import By
from po.base import Base


class Page(Base):
    iframe = (By.XPATH, '//*[@id="anony-reg-new"]/div/div[1]/iframe')
    phone = (By.XPATH, '/html/body/div[1]/div[2]/div[1]/div[3]/div/input')

    # 封装页面元素
    def inp(self):
        self.iframe_kj(self.iframe)

    def username(self):
        self.send_keys(self.phone, '15523615751')

    # 业务逻辑
    def luoji(self):
        self.open_url('https://www.douban.com/')
        self.inp()
        self.username()